import React, { Component } from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';
import WorksTop from '@/components/works/works-base/WorksTop';
import WorksNav from '@/components/works/works-base/WorksNav';
import LastUpload from './nologin/LastUpload';
import Popular from './nologin/Popular';
import Best from './nologin/Best';
class Com extends Component {
  constructor (props) {
    super(props);
    this.state = {
      list:[
        {
          path: '/works/lastUpload',
          name: '最新上传'
        },
        {
          path: '/works/popular',
          name: '正在流行'
        },
        {
          path: '/works/best',
          name: '24小时最佳'
        }
      ]
    }
  }

  render () {
    return (
        <div className="sectionNoLogin">
          <WorksTop />
          <WorksNav 
          list = { this.state.list } {...this.props}
          /> 
          <Switch>
            <Route path = "/works/lastUpload" component = { LastUpload } />
            <Route path = "/works/popular" component = { Popular } />
            <Route path = "/works/best" component = { Best } />
          </Switch>
        </div>
    )
  }
}

export default Com;
